package net.sunofbeach.blog.dao;

import net.sunofbeach.blog.pojo.Looper;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface LoopDao extends JpaRepository<Looper, String>, JpaSpecificationExecutor<Looper> {

    Looper findOneById(String loopId);

    @Query(nativeQuery = true,value = "select * from `tb_looper`  WHERE `state` = ? order by `create_time` DESC")
    List<Looper> listLoopByState(String s);
}
